package com.dc.project.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dc.common.validated.DeleteGroup;
import com.dc.common.validated.InsertGroup;
import com.dc.common.validated.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 用户角色关联表(SysUserRole)实体类
 *
 * @author zhuangcy
 * @since 2021-06-04 18:08:03
 */
@TableName("sys_user_role")
@Data
@ApiModel(value = "用户角色关联表")
public class SysUserRole implements Serializable {
    private static final long serialVersionUID = -44055248358765280L;
    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {UpdateGroup.class, DeleteGroup.class})
    @TableId(value = "user_role_id", type = IdType.AUTO)
    @ApiModelProperty(name = "userRoleId", value = "主键")
    private Long userRoleId;
    /**
     * 用户id
     */
    @NotNull(message = "用户id不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    @TableField(value = "user_id")
    @ApiModelProperty(name = "userId", value = "用户id")
    private Integer userId;
    /**
     * 角色id
     */
    @NotNull(message = "角色id不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    @TableField(value = "role_id")
    @ApiModelProperty(name = "roleId", value = "角色id")
    private Integer roleId;


}